// Programming_Scala/src/ch03/match-list-script.scala

def processList( l: List[Any] ): Unit = l match {
  case head :: tail =>
    print( format( "%s ", head ) )
    processList( tail )
  case Nil => println( "" )
}

val willWork = List( 1, 3, 23, 90 )
val willNotWork = List( 4, 18, 52 )
val empty = List()

for (l <- List( willWork, willNotWork, empty ) ) {
  print( "List: " )
  processList( l )
}
